package jmine.tec.hydra.receive.impl.file;

import java.io.File;
import java.io.FileFilter;
import java.io.Serializable;

import jmine.tec.annotations.Unmodifiable;

/**
 * Filtro de arquivos xml.
 * 
 * @author piercio
 */
@Unmodifiable
public class HydraFileFilter extends AbstractHydraFileFilter implements FileFilter, Serializable {

    private final String fileExtension;

    /**
     * Construtor
     * 
     * @param fileExtension fileExtension
     */
    public HydraFileFilter(String fileExtension) {
        this.fileExtension = fileExtension;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected boolean doAcceptFile(File file) {
        return file.getName().endsWith(this.fileExtension);
    }

}
